package Problem;

import java.util.Arrays;

//
// Created by ✎﹏ℳ๓独赏☆独醉 on 2024/1/14.
// 
public class 卡片 {
    public static void main(String[] args) {
        Integer[] arr = new Integer[10];
        Arrays.fill(arr, 2021);
        int i;
        int num;
        for (i = 1; !Arrays.asList(arr).contains(0); i++) {
            num = i;
            while (num!=0){
                arr[num%10]--;
                num/=10;
            }
        }
        i-=1;
        System.out.println(i);
    }
}
